package com.zzyl.controller.customer;


import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.controller.BaseController;
import com.zzyl.dto.NursingProjectDto;
import com.zzyl.service.NursingProjectService;
import com.zzyl.vo.NursingProjectVo;
import com.zzyl.vo.PageVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/customer/orders/project")
public class CustomerNursingProjectController extends BaseController {

    @Autowired
    private NursingProjectService nursingProjectService;

    @GetMapping("/page")
    @ApiOperation("分页查询护理项目列表")
    public ResponseResult<PageVo> getNursingProjectList(NursingProjectDto nursingDto) {
        PageResponse<NursingProjectVo> page = nursingProjectService.getNursingProjectList(nursingDto);
        return success(page);
    }

    @GetMapping("{id}")
    @ApiOperation("查询回显")
    public ResponseResult<NursingProjectVo> getNursingProjectById(@PathVariable("id") Long id){
        NursingProjectVo nursingProjectVo= nursingProjectService.getNursingProjectById(id);
        return success(nursingProjectVo);
    }
}
